﻿using AppService.IService.System_operation;
using Domain.Entity.System_operation;
using Domain.Entity.System_Ordermanagement;
using Domain.IRepository.System_operation;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace AppService.Service.System_operation
{
    [Dependency(ServiceLifetime.Scoped)]
    public class Receipt_meterService : IReceipt_meterService
    {
        private readonly IReceipt_meterRepository rm_Repository;

        public Receipt_meterService(IReceipt_meterRepository RmRepository)
        {
            this.rm_Repository = RmRepository;
        }

        public int Count(string? Sign_time, string? value2, string? Receipt_type, string? Ord_state)
        {
            return rm_Repository.Count(Sign_time,value2, Receipt_type, Ord_state);
        }

        public Orders GetOrd_id(int id)
        {
            return rm_Repository.GetOrd_id(id);
        }

        public Signature_receipt GetSign_id(int id)
        {
            return rm_Repository.GetSign_id(id);
        }

        public List<Receipt_meter> GetReceipt_meter(int currentPage, int PageSize)
        {
            return rm_Repository.GetReceipt_meter().Skip((currentPage - 1) * PageSize).Take(PageSize).ToList();
        }

        public bool BC(Receipt_meter receipt_Meter)
        {
            return rm_Repository.BC(receipt_Meter) > 0;
        }

        public Signature_receipt GetById()
        {
            return rm_Repository.GetById();
        }
    }
}
